cbuffer ShaderConstants : register(b0)
{
	float4x4 mTm : packoffset(c0);
	float4 rtClip : packoffset(c4);
};

struct VSINPUT 
{
	float4 pos : POSITION;
	float4 color : COLOR;
};

struct VSOUTPUT 
{
	float4 pos : SV_Position;
	float4 color : COLOR;
	float2 coord : TEXCOORD;
	float4 clip : CLIPDISTANCE;
};

VSOUTPUT VS(VSINPUT i) 
{
	VSOUTPUT o;
	
	o.pos = mul(mTm, float4(i.pos.xy, 0.0f, 1.0f));
	o.color = i.color;
	o.coord = i.pos.zw;
	o.clip = rtClip + float4(i.pos.xy, -i.pos.xy);
	
	return o;
}
